﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Vbyte.SharpOrm.SqlDb
{
    /// <summary>
    /// SQL Server的过滤器、SQL数据筛选设置
    /// </summary>
    public class SqlServerConstrains //: ISqlConstrains
    {
        /*
         ST:TODO
         *  Top 
         *  Distinct Max Min
         *  = <>
         *  Group By
         *  Between AND ---->   >= AND <=
         *  Fn > < >= <=
         */

        #region 关键字LIKE
        /*
        /// <summary>
        /// Determines whether [contains] [the specified prop name].
        /// </summary>
        /// <param name="propName">Name of the prop.</param>
        /// <param name="propValue">The prop value.</param>
        /// <returns></returns>
        public ISqlConstrains Contains(string propName, string propValue)
        {
            return this;
        }

        /// <summary>
        /// Determines whether [contains] [the specified prop value].
        /// </summary>
        /// <param name="propValue">The prop value.</param>
        /// <returns></returns>
        public ISqlConstrains Contains(string propValue)
        {
            return this;
        }

        /// <summary>
        /// Starts the with.
        /// </summary>
        /// <param name="propName">Name of the prop.</param>
        /// <param name="propValue">The prop value.</param>
        /// <returns></returns>
        public ISqlConstrains StartWith(string propName, string propValue)
        {

            return this;
        }

        /// <summary>
        /// Starts the with.
        /// </summary>
        /// <param name="propValue">The prop value.</param>
        /// <returns></returns>
        public ISqlConstrains StartWith(string propValue)
        {

            return this;
        }

        /// <summary>
        /// Ends the with.
        /// </summary>
        /// <param name="propName">Name of the prop.</param>
        /// <param name="propValue">The prop value.</param>
        /// <returns></returns>
        public ISqlConstrains EndWith(string propName, string propValue)
        {

            return this;
        }

        /// <summary>
        /// Ends the with.
        /// </summary>
        /// <param name="propValue">The prop value.</param>
        /// <returns></returns>
        public ISqlConstrains EndWith(string propValue)
        {

            return this;
        }

        /// <summary>
        /// Matches the specified prop name.
        /// </summary>
        /// <param name="propName">Name of the prop.</param>
        /// <param name="sqlMatch">The SQL match.</param>
        /// <returns></returns>
        public ISqlConstrains Match(string propName, string sqlMatch)
        {

            return this;
        }

        /// <summary>
        /// Matches the specified SQL match.
        /// </summary>
        /// <param name="sqlMatch">The SQL match.</param>
        /// <returns></returns>
        public ISqlConstrains Match(string sqlMatch)
        {

            return this;
        }
         */
        #endregion

        #region 关键词IN
        /*
        /// <summary>
        /// Ins the specified prop name.
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="propName">Name of the prop.</param>
        /// <param name="array">The array.</param>
        /// <returns></returns>
        public ISqlConstrains In<T>(string propName, T[] array)
        {
            return this;
        }

        /// <summary>
        /// Ins the specified array.
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="array">The array.</param>
        /// <returns></returns>
        public ISqlConstrains In<T>(T[] array)
        {
            return this;
        }
        */
        #endregion

        #region 关系计算操作符
        /*
        /// <summary>
        /// 表示和操作AND
        /// </summary>
        public static ISqlConstrains operator +(ISqlConstrains f1, ISqlConstrains f2)
        {
            return f1;
        }

        /// <summary>
        /// 表式或操作OR
        /// </summary>
        public static ISqlConstrains operator |(ISqlConstrains f1, ISqlConstrains f2)
        {
            return f1;
        }

        /// <summary>
        /// 表示非操作NOT
        /// </summary>
        public static ISqlConstrains operator !(ISqlConstrains filter)
        {
            return filter;
        }

        ///// <summary>
        ///// Performs an implicit conversion from <see cref="Vbyte.SharpOrm.Config.Constrains"/> to <see cref="System.String"/>.
        ///// </summary>
        ///// <param name="filter">The filter.</param>
        ///// <returns>The result of the conversion.</returns>
        //public static implicit operator string(Constrains filter)
        //{
        //    return "";
        //}

        /// <summary>
        /// Performs an explicit conversion from <see cref="Vbyte.SharpOrm.Constrains"/> to <see cref="System.String"/>.
        /// </summary>
        /// <param name="filter">The filter.</param>
        /// <returns>The result of the conversion.</returns>
        public static explicit operator string(ISqlConstrains filter)
        {
            return "";
        }
        */
        #endregion

        /// <summary>
        /// Toes the SQL fiter.
        /// </summary>
        /// <returns></returns>
        public string ToSqlFiter()
        {
            //EntryFilter f = new EntryFilter().Contains("Name", "ridge")
            //    .EndWith("Name", "wong");

            //EntryFilter g = new EntryFilter().In<int>("ProductID", new int[] { 1, 2, 3 });

            //EntryFilter s = new EntryFilter().In<string>("ProductName", new string[] { "nokia", "moto" });

            return "";
        }

        /// <summary>
        /// Tests this instance.
        /// </summary>
        public void test()
        {
            //ISqlConstrains f = new SqlServerConstrains();
            //ISqlConstrains f2 = f + new SqlServerConstrains();
            //if (f2 == !f)
            //{

            //}


        }

    }

}
